import { Controller, Get, Query, Post, Body, Param } from '@nestjs/common';
import { UserService } from './user.service';
import { User } from './interfaces/user.interfaces'
import { ApiTags } from "@nestjs/swagger";

@ApiTags('用户')
@Controller('/user')
export class UserController {
  // 基于构造函数的依赖注入
  constructor(private readonly userService: UserService) {}
  // @Get('/name')
  // getName(@Query('id') id: number): string {
  //   return this.userService.getName(id);
  // }

  @Post('/createUser')
  createUser(@Body() user: User) {
    return this.userService.create(user)
  }
}
